<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="icon" href="https://static.nowcoder.com/images/logo_87_87.png"/>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" crossorigin="anonymous">
    <link rel="stylesheet" th:href="@{/css/global.css}" />
    <link rel="stylesheet" th:href="@{/lib/editormd/css/editormd.min.css}" />
    <title th:text="${post==null||post.draft==1?'新帖发布':'修改帖子'}">新帖发布</title>
</head>
<body>
<div class="nk-container">
    <!-- 头部 -->
    <header class="bg-dark sticky-top" th:replace="index::header">
    </header>

    <!-- 内容 -->
    <div class="main">
        <div class="container" style="width: 1200px">
            <button class="btn btn-info float-right" onclick="issue()" type="button">发布</button>
            <button class="btn btn-secondary float-right" onclick="draft()" style="margin-right: 10px" type="button">保存</button>
            <button class="btn " onclick="window.history.go(-1)"><img th:src="@{/img/back.png}"/></button>
            <form>
                <input type="hidden" name="id" th:value="${post==null?'':post.id}"/>
                <input type="text" th:value="${post==null?'':post.title}" class="form-control mr-sm-2" name="title" placeholder="标题" style="margin-top: 10px;margin-bottom: 10px">
                <div id="md-content">
                    <textarea name="content" th:text="${post==null?'':post.content}"></textarea>
                </div>
            </form>
        </div>
    </div>

    <!-- 尾部 -->
    <footer class="bg-dark" th:replace="index::footer">
    </footer>
</div>

<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bs-custom-file-input/dist/bs-custom-file-input.js" crossorigin="anonymous"></script>
<script th:src="@{/js/global.js}"></script>
<script th:src="@{/lib/editormd/editormd.min.js}"></script>
<script th:src="@{/js/markdown.js}"></script>
</body>
</html>
